home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / libs / x / xview / xview3.004 / xview3 / usr / openwin / include / olgx / olgx.h
Encoding:
C/C++ Source or Header  |  1996-05-30  |  21.0 KB  |  614 lines

  1. /* 
  2.  * @(#) olgx.h 1.48 93/06/28 
  3.  */
  4.  
  5. /*
  6.  * OPEN LOOK object drawing package
  7.  * Sun Microsystems, Inc.,
  8.  */
  9.  
  10. #ifndef OL_PUBLIC_DEFINED
  11. #define OL_PUBLIC_DEFINED
  12.  
  13. #include <X11/Xlib.h>
  14. #ifdef OW_I18N
  15. #if ! defined(XlibSpecificationRelease) || XlibSpecificationRelease < 5
  16. #include <X11/XlibR5.h>          
  17. #endif /* XlibSpecificationRelease != 5 */
  18. #endif /* OW_I18N */
  19.  
  20. /*
  21.  * Package constant definitions
  22.  */
  23.  
  24.  
  25. /*
  26.  * Monitor dependent  definitons  
  27.  */
  28.  
  29. #define OLGX_2D                0
  30. #define OLGX_3D_COLOR          1
  31. #define OLGX_3D_MONO           2
  32.  
  33.  
  34.  
  35.  
  36. /*     GC number definitions     */
  37.  
  38. #define NONE               -1    /* means "don't draw in this color" */
  39. #define OLGX_WHITE        0
  40. #define OLGX_BLACK        1
  41. #define OLGX_BG1        2
  42. #define OLGX_BG2        3
  43. #define OLGX_BG3        4
  44. #define OLGX_NUM_COLORS        5    /* 1 more than last *color* GC */
  45.  
  46. #define OLGX_TEXTGC        5
  47. #define OLGX_GREY_OUT        6       /* Inactive GC  */
  48. #define OLGX_BUSYGC        7
  49. #define OLGX_SCROLL_GREY_GC     8       /* Special GC for 50% black cable */
  50. #define OLGX_NUM_GCS        9    /* always 1 more than last GC */
  51.  
  52. /* 2D gc definitions */
  53.  
  54. #define OLGX_TEXTGC_REV         2      /* Is used only for 2D hence
  55.                       substituted for OLGX_BG1 
  56.                     */
  57. /*
  58.  * State Flag Definitions
  59.  */
  60. #define OLGX_NORMAL        0x0000    /* normal button */
  61. #define OLGX_INVOKED        0x0001    /* invoked button */
  62. #define OLGX_MENU_ITEM        0x0002    /* menu item */
  63. #define    OLGX_ERASE        0x0004    /* erase first (only for menu items) */
  64. #define OLGX_BUSY        0x0008    /* busy item */
  65. #define OLGX_DEFAULT        0x0010    /* default item */
  66. #define OLGX_INACTIVE        0x0020    /* inactive item */
  67. #define OLGX_VERT_MENU_MARK    0x0040    /* include a vertical menu mark */
  68. #define OLGX_HORIZ_MENU_MARK    0x0080    /* include a horizontal menu mark */
  69. #define OLGX_VERT_BACK_MENU_MARK 0x2000    /* include a vertical menu mark */
  70. #define OLGX_HORIZ_BACK_MENU_MARK 0x4000/* include a horizontal menu mark */
  71. #define OLGX_DIAMOND_MARK       0x8000  /* include a diamond mark */
  72. #define OLGX_MENU_MARK        0x00c0    /* VERT_MENU_MARK | HORIZ_MENU_MARK */
  73. #define OLGX_LABEL_IS_PIXMAP    0x0200    /* button label is a pixmap */
  74. #define OLGX_LABEL_IS_XIMAGE    0x2000    /* button label is an ximage */
  75. #define OLGX_LABEL_HAS_UNDERLINE 0x0800    /* button label has underline */
  76. #define OLGX_LABEL_HAS_HIGHLIGHT 0x1000    /* button label has highlight */
  77. #ifdef OW_I18N
  78. #define OLGX_LABEL_IS_WCS      0x10000 /* button label is a wide char str */
  79. #endif
  80. #define OLGX_VERTICAL         0x0800    /* orientation is vertical */
  81. #define OLGX_HORIZONTAL     0x1000    /* orientation is horizontal */
  82. #define OLGX_PUSHPIN_OUT    0x2000    /* pushpin is in */
  83. #define OLGX_PUSHPIN_IN        0x4000    /* pushpin is out */
  84. #define OLGX_UPDATE        0x8000    /* object is to be updated */
  85. #define OLGX_ABBREV        0x0100    /* object is abbreviated */
  86. #define OLGX_CHECKED        0x0002    /* object is checked (check boxes) */
  87. #define OLGX_MORE_ARROW         0x0400  /* more arrow added for truncated text */
  88.  
  89. /* scrollbar -2d stateflag defns */
  90.  
  91. #define OLGX_SCROLL_FORWARD        0x0002    /*scroll forward */
  92. #define OLGX_SCROLL_BACKWARD        0x2000    /*scroll backward */
  93. #define OLGX_SCROLL_ABSOLUTE        0x4000    /*scroll absolute-
  94.                           center darkened  */
  95. #define OLGX_SCROLL_NO_FORWARD          0x0040  /* no scroll forward */
  96. #define OLGX_SCROLL_NO_BACKWARD         0x0080  /* no scroll backward */
  97.  
  98. /*
  99.  * corner definitions
  100.  */
  101.  
  102. #define OLGX_UPPER_LEFT        0
  103. #define OLGX_UPPER_RIGHT    1
  104. #define OLGX_LOWER_RIGHT    2
  105. #define OLGX_LOWER_LEFT        3
  106.  
  107. /*
  108.  * Special Definition !!
  109.  *
  110.  */
  111.  
  112. #define OLGX_SPECIAL            1
  113.  
  114. /*
  115.  * character definitions
  116.  */
  117. #define OLG_VSB_ELEVATOR                        1
  118. #define OLG_VSB_ELEVATOR_LINE_BACKWARD          2
  119. #define OLG_VSB_ELEVATOR_ABSOLUTE               3
  120. #define OLG_VSB_ELEVATOR_LINE_FORWARD           4
  121. #define OLG_VSB_REDUCED_ELEVATOR                5
  122. #define OLG_VSB_REDUCED_ELEVATOR_LINE_BACKWARD  6
  123. #define OLG_VSB_REDUCED_ELEVATOR_LINE_FORWARD   7
  124. #define OLG_VSB_ANCHOR                          8
  125. #define OLG_VSB_ANCHOR_INVERTED                 9
  126. #define OLG_HSB_ELEVATOR                        10
  127. #define OLG_HSB_ELEVATOR_LINE_BACKWARD          11
  128. #define OLG_HSB_ELEVATOR_ABSOLUTE               12
  129. #define OLG_HSB_ELEVATOR_LINE_FORWARD           13
  130. #define OLG_HSB_REDUCED_ELEVATOR                14
  131. #define OLG_HSB_REDUCED_ELEVATOR_LINE_BACKWARD  15
  132. #define OLG_HSB_REDUCED_ELEVATOR_LINE_FORWARD   16
  133. #define OLG_HSB_ANCHOR                          17
  134. #define OLG_HSB_ANCHOR_INVERTED                 18
  135. #define OLG_MENU_PIN_OUT                        19
  136. #define OLG_MENU_PIN_IN                         20
  137. #define OLG_MENU_DEFAULT_PIN_OUT                21
  138. #define OLG_ABBREV_MENU_BUTTON                  22
  139. #define OLG_ABBREV_MENU_BUTTON_INVERTED         23
  140. /* new extension */
  141. #define BUTTON_UL                24
  142. #define BUTTON_LL                25
  143. #define BUTTON_LEFT_ENDCAP_FILL            26
  144. #define BUTTON_LR                27
  145. #define BUTTON_UR                28
  146. #define BUTTON_RIGHT_ENDCAP_FILL        29
  147. #define BUTTON_TOP_1                30
  148. #define BUTTON_TOP_2                31
  149. #define BUTTON_TOP_4                32
  150. #define BUTTON_TOP_8                33
  151. #define BUTTON_TOP_16                34
  152. #define BUTTON_BOTTOM_1                35
  153. #define BUTTON_BOTTOM_2                36
  154. #define BUTTON_BOTTOM_4                37
  155. #define BUTTON_BOTTOM_8                38
  156. #define BUTTON_BOTTOM_16            39
  157. #define BUTTON_FILL_1                40
  158. #define BUTTON_FILL_2                41
  159. #define BUTTON_FILL_4                42
  160. #define BUTTON_FILL_8                43
  161. #define BUTTON_FILL_16                44
  162. #define VERT_MENU_MARK_UL            45
  163. #define VERT_MENU_MARK_LR            46
  164. #define VERT_MENU_MARK_FILL            47
  165. #define HORIZ_MENU_MARK_UL            48
  166. #define HORIZ_MENU_MARK_LR            49
  167. #define HORIZ_MENU_MARK_FILL            50
  168. #define ABBREV_MENU_UL                51
  169. #define ABBREV_MENU_LR                52
  170. #define ABBREV_MENU_FILL            53
  171. #define VERT_SB_UL                54
  172. #define VERT_SB_LR                55
  173. #define VERT_SB_TOPBOX_FILL            56
  174. #define HORIZ_SB_UL                57
  175. #define HORIZ_SB_LR                58
  176. #define VERT_SB_BOTBOX_FILL            59
  177. #define HORIZ_SLIDER_CONTROL_UL            60
  178. #define HORIZ_SLIDER_CONTROL_LR            61
  179. #define HORIZ_SLIDER_CONTROL_FILL        62
  180. #define HORIZ_SLIDER_UL                63
  181. #define HORIZ_SLIDER_LL                64
  182. #define HORIZ_SLIDER_UR                65
  183. #define HORIZ_SLIDER_LR                66
  184. #define HORIZ_SLIDER_BOTTOM_1            67
  185. #define HORIZ_SLIDER_BOTTOM_2            68
  186. #define HORIZ_SLIDER_BOTTOM_4            69
  187. #define HORIZ_SLIDER_BOTTOM_8            70
  188. #define HORIZ_SLIDER_BOTTOM_16            71
  189. #define HORIZ_SLIDER_FILL_1            72
  190. #define HORIZ_SLIDER_FILL_2            73
  191. #define HORIZ_SLIDER_FILL_4            74
  192. #define HORIZ_SLIDER_FILL_8            75
  193. #define HORIZ_SLIDER_FILL_16            76
  194. #define HORIZ_SLIDER_LEFT_ENDCAP_FILL        77
  195. #define HORIZ_SLIDER_RIGHT_ENDCAP_FILL        78
  196. #define VERT_SLIDER_UL                79
  197. #define VERT_SLIDER_UR                80
  198. #define VERT_SLIDER_TOP_ENDCAP_FILL        81
  199. #define VERT_SLIDER_LL                82
  200. #define VERT_SLIDER_LR                83
  201. #define VERT_SLIDER_BOTTOM_ENDCAP_FILL        84
  202. #define VERT_SLIDER_CONTROL_UL            85
  203. #define VERT_SLIDER_CONTROL_LR            86
  204. #define VERT_SLIDER_CONTROL_FILL        87
  205. #define UL_RESIZE_UL                88
  206. #define UL_RESIZE_LR                89
  207. #define UL_RESIZE_FILL                90
  208. #define UR_RESIZE_UL                91
  209. #define UR_RESIZE_LR                92
  210. #define UR_RESIZE_FILL                93
  211. #define LR_RESIZE_UL                94
  212. #define LR_RESIZE_LR                95
  213. #define LR_RESIZE_FILL                96
  214. #define LL_RESIZE_UL                97
  215. #define LL_RESIZE_LR                98
  216. #define LL_RESIZE_FILL                99
  217. #define PUSHPIN_OUT_TOP                100
  218. #define PUSHPIN_OUT_BOTTOM            101
  219. #define PUSHPIN_OUT_MIDDLE            102
  220. #define PUSHPIN_IN_TOP                103
  221. #define PUSHPIN_IN_BOTTOM            104
  222. #define PUSHPIN_IN_MIDDLE            105
  223. #define DFLT_BUTTON_LEFT_ENDCAP            106
  224. #define DFLT_BUTTON_RIGHT_ENDCAP        107
  225. #define DFLT_BUTTON_MIDDLE_1            108
  226. #define DFLT_BUTTON_MIDDLE_2            109
  227. #define DFLT_BUTTON_MIDDLE_4            110
  228. #define DFLT_BUTTON_MIDDLE_8            111
  229. #define DFLT_BUTTON_MIDDLE_16            112
  230. #define BASE_OFF_SPECIALCHAR            113 /*special char */
  231. #define UNCHECKED_BOX_UL            114
  232. #define UNCHECKED_BOX_LR            115
  233. #define UNCHECKED_BOX_FILL            116
  234. #define CHECK_MARK                117
  235. #define CHECKED_BOX_FILL            118
  236. #define UNCHECKED_BOX_OUTLINE            119
  237. #define HORIZ_GAUGE_UL                120
  238. #define HORIZ_GAUGE_LL                121
  239. #define HORIZ_GAUGE_UR                122
  240. #define HORIZ_GAUGE_LR                123
  241. #define HORIZ_GAUGE_BOTTOM_1            124
  242. #define HORIZ_GAUGE_BOTTOM_2            125
  243. #define HORIZ_GAUGE_BOTTOM_4            126
  244. #define HORIZ_GAUGE_BOTTOM_8            127
  245. #define HORIZ_GAUGE_BOTTOM_16            128
  246. #define VERT_GAUGE_UL                129
  247. #define VERT_GAUGE_UR                130
  248. #define VERT_GAUGE_LL                131
  249. #define VERT_GAUGE_LR                132
  250. #define VERT_ABBREV_SB_UL            133
  251. #define VERT_ABBREV_SB_LR            134
  252. #define HORIZ_SB_RIGHTBOX_FILL            135
  253. #define HORIZ_ABBREV_SB_UL            136
  254. #define HORIZ_ABBREV_SB_LR            137
  255. #define HORIZ_SB_LEFTBOX_FILL            138
  256. #define BUTTON_OUTLINE_LEFT_ENDCAP        139
  257. #define BUTTON_OUTLINE_RIGHT_ENDCAP        140
  258. #define BUTTON_OUTLINE_MIDDLE_1            141
  259. #define BUTTON_OUTLINE_MIDDLE_2            142
  260. #define BUTTON_OUTLINE_MIDDLE_4            143
  261. #define BUTTON_OUTLINE_MIDDLE_8            144
  262. #define BUTTON_OUTLINE_MIDDLE_16        145
  263. #define BUTTON_FILL_2D_LEFTENDCAP        146
  264. #define BUTTON_FILL_2D_RIGHTENDCAP          147
  265. #define BUTTON_FILL_2D_MIDDLE_1             148
  266. #define BUTTON_FILL_2D_MIDDLE_2         149
  267. #define BUTTON_FILL_2D_MIDDLE_4         150
  268. #define BUTTON_FILL_2D_MIDDLE_8         151
  269. #define BUTTON_FILL_2D_MIDDLE_16        152
  270. #define MENU_DFLT_OUTLINE_LEFT_ENDCAP           153
  271. #define MENU_DFLT_OUTLINE_RIGHT_ENDCAP          154
  272. #define MENU_DFLT_OUTLINE_MIDDLE_1              155
  273. #define MENU_DFLT_OUTLINE_MIDDLE_2              156
  274. #define MENU_DFLT_OUTLINE_MIDDLE_4              157
  275. #define MENU_DFLT_OUTLINE_MIDDLE_8              158
  276. #define MENU_DFLT_OUTLINE_MIDDLE_16             159
  277. #define PIXLABEL_BUTTON_UL            160 
  278. #define PIXLABEL_BUTTON_LL            161
  279. #define UL_RESIZE_OUTLINE            162
  280. #define UR_RESIZE_OUTLINE            163
  281. #define LR_RESIZE_OUTLINE            164
  282. #define LL_RESIZE_OUTLINE            165
  283. #define VERT_SB_NO_BACK_OUTLINE                 166
  284. #define VERT_SB_NO_FWD_OUTLINE                  167
  285. #define VERT_SB_INACTIVE_OUTLINE                168
  286. #define HORIZ_SB_NO_BACK_OUTLINE                169
  287. #define HORIZ_SB_NO_FWD_OUTLINE                 170
  288. #define HORIZ_SB_INACTIVE_OUTLINE               171
  289. #define HORIZ_SLIDER_CONTROL_OUTLINE        172
  290. #define HORIZ_SLIDER_LEFT_ENDCAP_OUTLINE    173
  291. #define    HORIZ_SLIDER_RIGHT_ENDCAP_OUTLINE    174
  292. #define HORIZ_SLIDER_OUTLINE_1            175
  293. #define HORIZ_SLIDER_OUTLINE_2            176
  294. #define HORIZ_SLIDER_OUTLINE_4            177
  295. #define HORIZ_SLIDER_OUTLINE_8            178
  296. #define HORIZ_SLIDER_OUTLINE_16            179
  297. #define VERT_SLIDER_TOP_ENDCAP_OUTLINE        180
  298. #define VERT_SLIDER_BOTTOM_ENDCAP_OUTLINE    181
  299. #define VERT_SLIDER_CONTROL_OUTLINE        182
  300. #define PUSHPIN_OUT_DEFAULT_TOP         183
  301. #define PUSHPIN_OUT_DEFAULT_BOTTOM         184
  302. #define PUSHPIN_OUT_DEFAULT_MIDDLE         185
  303. #define HORIZ_GAUGE_LEFT_ENDCAP_OUTLINE        186
  304. #define HORIZ_GAUGE_RIGHT_ENDCAP_OUTLINE    187
  305. #define HORIZ_GAUGE_OUTLINE_MIDDLE_1        188
  306. #define HORIZ_GAUGE_OUTLINE_MIDDLE_2        189
  307. #define HORIZ_GAUGE_OUTLINE_MIDDLE_4        190
  308. #define HORIZ_GAUGE_OUTLINE_MIDDLE_8        191
  309. #define HORIZ_GAUGE_OUTLINE_MIDDLE_16        192
  310. #define CHECK_BOX_CLEAR_FILL            193
  311. #define VERT_SB_BOX_UL                 194
  312. #define VERT_SB_BOX_LR                 195
  313. #define DIMPLE_UL                196
  314. #define DIMPLE_LR                197
  315. #define DIMPLE_FILL                198
  316. #define SLIDER_CHANNEL_OFFSET            199 /* special char */
  317. #define HORIZ_SB_BOX_UL                200
  318. #define HORIZ_SB_BOX_LR                201
  319. #define VERT_BACK_MENU_MARK_UL            202
  320. #define VERT_BACK_MENU_MARK_LR            203
  321. #define VERT_BACK_MENU_MARK_FILL        204
  322. #define HORIZ_BACK_MENU_MARK_UL            205
  323. #define HORIZ_BACK_MENU_MARK_LR            206
  324. #define HORIZ_BACK_MENU_MARK_FILL        207
  325. #define    OLGX_ACTIVE_CARET            208
  326. #define OLGX_INACTIVE_CARET            209
  327. #define VERT_GAUGE_TOPENDCAP               210
  328. #define VERT_GAUGE_BOTENDCAP               211
  329. #define PIXLABEL_BUTTON_UR               212
  330. #define PIXLABEL_BUTTON_LR               213
  331. #define PIXLABEL_BUTTON_2D_LR             214
  332. #define PIXLABEL_DEF_BUTTON_UL             215
  333. #define PIXLABEL_DEF_BUTTON_LL             216
  334. #define PIXLABEL_DEF_BUTTON_UR             217
  335. #define PIXLABEL_DEF_BUTTON_LR             218
  336. #define HORIZ_GAUGE_LEFT_ENDFILL                219
  337. #define HORIZ_GAUGE_MIDDLE_FILL_1               220
  338. #define HORIZ_GAUGE_MIDDLE_FILL_2               221
  339. #define HORIZ_GAUGE_MIDDLE_FILL_4               222
  340. #define HORIZ_GAUGE_MIDDLE_FILL_8               223
  341. #define HORIZ_GAUGE_MIDDLE_FILL_16              224
  342. #define HORIZ_GAUGE_RIGHT_ENDFILL               225
  343. #define VERT_GAUGE_TOP_FILL                     226
  344. #define VERT_GAUGE_BOT_FILL                     227
  345. #define TEXTSCROLLBUTTON_LEFT                   228
  346. #define TEXTSCROLLBUTTON_RIGHT                  229
  347. #define TEXTSCROLLBUTTON_LEFT_INV               230
  348. #define TEXTSCROLLBUTTON_RIGHT_INV              231
  349. #define NUMERIC_SCROLL_BUTTON_NORMAL            232
  350. #define NUMERIC_SCROLL_BUTTON_LEFT_INV          233
  351. #define NUMERIC_SCROLL_BUTTON_RIGHT_INV         234
  352.  
  353.  
  354. /*
  355.  * Definitions needed for XView 
  356.  */
  357.  
  358.  
  359. #define OLGX_VAR_HEIGHT_BTN_MARGIN              10
  360. #define OLGX_CHOICE_MARGIN                      10
  361. #define OLGX_VAR_HEIGHT_BTN_ENDCAP_WIDTH        5
  362.  
  363.  
  364. #ifdef OW_I18N
  365.  
  366. /*
  367.  * Definision for the Graphics Info flag (Olgx_Flags)
  368.  */
  369.  
  370. #define    OLGX_FONTSET    (1<<0)
  371.  
  372. #endif /* OW_I18N */
  373.  
  374.  /*
  375.  * Type and Structure Definitions
  376.  */
  377.  
  378.  
  379. typedef struct _GC_rec {
  380.   GC gc;
  381.   short ref_count;
  382.   int   num_cliprects;          /* Information to set clip rectangles
  383.   XID   clipmask;                * or clipmasks on the GCs
  384.   int   clip_flag;               */
  385.   unsigned long valuemask;      /* what fields are being used */
  386.   XGCValues values;             /* Values stored  */
  387.   struct _GC_rec * next;    /* Pointer to the next gc_info in the list */
  388.   int      depth;
  389. } GC_rec;
  390.  
  391. typedef struct pixlabel {
  392.   Pixmap pixmap;
  393.   int width,height;
  394. } Pixlabel;
  395.  
  396. typedef struct ximlabel {
  397.   XImage *ximage;
  398.   int width,height;
  399. } Ximlabel;
  400.  
  401. typedef struct underlinelabel {
  402.   void *label;
  403.   int position;
  404. } Underlinelabel;
  405.  
  406. #ifdef OW_I18N
  407. typedef union olgx_font_or_fs{
  408.     XFontSet     fontset;        /* ptr to text font set info */
  409.     XFontStruct *fontstruct;        /* ptr to text font info */
  410. } Olgx_font_or_fs;
  411. #endif
  412.  
  413. /*
  414.  * Graphics information structure
  415.  */
  416. typedef struct graphics_info {
  417.   Display *dpy;
  418.   int scrn;
  419.   unsigned int depth;                /* depth in which we are drawing */
  420.   XFontStruct *glyphfont;        /* ptr to glyph font info*/
  421. #ifdef OW_I18N
  422.   Olgx_font_or_fs utextfont;
  423. #else
  424.   XFontStruct *textfont;        /* ptr to text font info */
  425. #endif
  426.   short      three_d;        /* Either one of OLGX_2D,
  427.                      * OLGX_3D_COLOR,OLGX_3D_MONO
  428.                      */
  429.                         
  430.   GC_rec     * gc_rec[OLGX_NUM_GCS];
  431.  
  432.       /* OLGX_3D_MONO has been nuked....
  433.        * info->stipple_pixmaps[3] has been changed to info->drawable[3]
  434.        * and info->drawable[0] is used for storing the drawable associated
  435.        * with the ginfo. In other words, since stipple_pixmaps is no
  436.        * longer going to be used, we are using up this space to
  437.        * avoid binary compatiblity problem between 2.0 and 3.0 
  438.        * info->drawable[1-2] are still blank.
  439.        */
  440. #ifdef OW_I18N
  441.       /*
  442.        * with OW_I18N, info->drawable[1] is redefined to be Olgx_Flags
  443.        * (macro).  This Olgx_Flags being used to distinguish between
  444.        * i18n/fontset and main/fontstruct instance.
  445.        */
  446. #define    _Olgx_Flags    drawable[1]
  447. #endif /* OW_I18N */
  448.   Pixmap        drawable[3];
  449.   unsigned long pixvals[OLGX_NUM_COLORS];
  450.   
  451.   /*
  452.    * important OPEN LOOK values associated with this glyph font
  453.    */
  454.  
  455.   short    button_height;            /* height of buttons */
  456.   short    endcap_width;            /* size of button endcap */
  457.   short    sb_width, sb_height;        /* scrollbar elevator size */
  458.   short    abbrev_width;                     /* abbrev menu button size */
  459.   short    slider_width, slider_height;    /* slider control size */
  460.   short    se_width, se_height;        /* slider endcap size */
  461.   short    mm_width, mm_height;        /* menu mark size */
  462.   short base_off           ;            /* Text base_off */
  463.   short slider_offset           ;       /*SliderChanneloffset */
  464.   short    cb_width, cb_height;        /* check box size */
  465.   short    pp_width, pp_height;        /* push pin  size*/
  466.   short gauge_width,gauge_height ;      /* gauge width& height*/
  467.   short textscbu_width ;                /* text scroll button width */
  468.   short gauge_endcapOffset ;            /* Offset between the endcap and gauge
  469.                      * channel
  470.                      */
  471.   short numscbu_width;                  /* Number Scrolling button Width */
  472.   short resize_arm_width;               /* Resize Corner Width  */
  473.   short abbsb_height ;                  /* Abbreviated Scrollbar Height */
  474.   short cable_offset    ;               /* Cable offset distance from
  475.                      * the Scrollbar origin */
  476.   short cable_width  ;                  /* Width of the Cable */
  477.   short point_size   ;                /* Pixel Point size of the Font */
  478.   short dtarget_height;                 /* Drop Target Height */
  479.   short dtarget_width;                  /* Drop Target Width */
  480.   short dtarget_swidth;                 /* Drop Target Stroke Width */
  481.   short dtarget_ewidth;                 /* Drop Target Edge Width */
  482.  
  483.  
  484. } Graphics_info;
  485.  
  486.  
  487. /* Public macro definitions to get info from the Ginfo struct  */
  488.  
  489.  
  490. #define ScrollbarElevator_Height(info)       \
  491.   (info->three_d)?((info)->sb_height-1):((info)->sb_height)        
  492.  
  493. #define ScrollbarElevator_Width(info)       \
  494.   (info->three_d)?((info)->sb_width-1):((info) ->sb_width)        
  495.  
  496.  
  497. #define HorizSliderControl_Width(info)  ((info)->slider_width)
  498. #define HorizSliderControl_Height(info) ((info)->slider_height)
  499. #define SliderEndCap_Width(info)       ((info)->se_width)
  500. #define SliderEndCap_Height(info)       ((info)->se_height)
  501. #define CheckBox_Height(info)       ((info)->cb_height)
  502. #define CheckBox_Width(info)        ((info)->cb_width)
  503. #define PushPinIn_Width(info)           ((info)->pp_height)
  504. #define PushPinOut_Width(info)        ((info)->pp_width)
  505. #define PushPinOut_Height(info)        ((info)->pp_height)
  506. #define ButtonEndcap_Width(info)     ((info)->endcap_width)
  507. #define Button_Height(info)       \
  508.   ((info->three_d)?((info)->button_height-1):((info)->button_height))
  509. #define MenuMark_Width(info)         ((info)->mm_width)
  510. #define MenuMark_Height(info)         ((info)->mm_height)
  511. #define Abbrev_MenuButton_Height(info)     ((info)->abbrev_width -1)
  512. #define Abbrev_MenuButton_Width(info)     ((info)->abbrev_width)
  513. #define Gauge_EndCapWidth(info)         ((info)->gauge_width)
  514. #define Gauge_EndCapHeight(info)           ((info)->gauge_height)
  515. #define Gauge_EndCapOffset(info)       ((info)->gauge_endcapOffset)
  516. #define TextScrollButton_Width(info)    ((info)->textscbu_width)
  517. #define TextScrollButton_Height(info)   ((info)->textscbu_width)
  518. #define NumScrollButton_Width(info)     ((info)->numscbu_width)
  519. #define NumScrollButton_Height(info)    ((info)->textscbu_width)
  520. #define ResizeArm_Width(info)           ((info)->resize_arm_width)
  521. #define ResizeArm_Height(info)          ((info)->resize_arm_width)
  522. #ifdef OW_I18N
  523. #define Ascent_of_TextFont(info)        ((info)->utextfont.fontstruct->ascent)
  524. #define Descent_of_TextFont(info)       ((info)->utextfont.fontstruct->descent)
  525. #else
  526. #define Ascent_of_TextFont(info)        ((info)->textfont->ascent)
  527. #define Descent_of_TextFont(info)       ((info)->textfont->descent)
  528. #endif
  529. #define Ascent_of_GlyphFont(info)       ((info)->glyphfont->ascent)
  530. #define Descent_of_GlyphFont(info)      ((info)->glyphfont->descent)
  531. #define Pointsize_Glyph(info)           ((info)->point_size)
  532. #define Vertsb_Endbox_Height(info)      (SliderEndCap_Height(info) + 1)
  533. #define Vertsb_Endbox_Width(info)       (ScrollbarElevator_Width(info))
  534. #define Dimension(info)                 ((info)->three_d)
  535. #ifdef OW_I18N
  536. #define TextFont_Struct(info)           ((info)->utextfont.fontstruct)
  537. #define TextFont_Set(info)              ((info)->utextfont.fontset)
  538. #define    Olgx_Flags(info)        ((info)->_Olgx_Flags)
  539. #else
  540. #define TextFont_Struct(info)           ((info)->textfont)
  541. #endif
  542. #define GlyphFont_Struct(info)          ((info)->glyphfont)
  543. #define AbbScrollbar_Height(ginfo)      ((info)->abbsb_height)
  544. #define DropTarget_Width(info)          ((info)->dtarget_width)
  545. #define DropTarget_Height(info)         ((info)->dtarget_height)
  546.  
  547. /*
  548.  * Public macros to calculate the positions for menu accelerators`
  549.  */
  550.  
  551. #define ButtonSpace_Width(info)         ((info)->mm_width)
  552. #define MainLabel_Pos(info,x)           (x + (info)->endcap_width)
  553. #define ButtonMark_Pos(info,m_pos,max_mlabel_length,max_qlabel_length) \
  554.       (m_pos+ButtonSpace_Width(info)*3+(max_mlabel_length)+(max_qlabel_length))
  555. #define KeyLabel_Pos(info,mark_pos)     (mark_pos + ButtonSpace_Width(info)*2)
  556. #define QualifierLabel_Pos(info,mark_pos,qlabel_length) \
  557.         (mark_pos - ButtonSpace_Width(info) - qlabel_length)
  558. #define Button_Width(info,x,key_pos,max_klabel_length) \
  559.         (key_pos + (info)->endcap_width + max_klabel_length -x)
  560.  
  561. /*
  562.  * Public function declarations
  563.  */
  564.  
  565.  
  566. Graphics_info *   olgx_main_initialize();
  567. #ifdef OW_I18N
  568. Graphics_info *   olgx_i18n_initialize();
  569. #endif
  570. Graphics_info *   olgx_initialize();
  571. void              olgx_calculate_3Dcolors();
  572. unsigned long     olgx_get_single_color();
  573. void          olgx_closedown();
  574. void          olgx_destroy();
  575.  
  576.  
  577. #define olgx_draw_accel_text   olgx_draw_accel_label
  578.  
  579. void    
  580.   olgx_set_text_font(),
  581. #ifdef OW_I18N
  582.   olgx_set_text_fontset(),
  583. #endif
  584.   olgx_set_glyph_font(),
  585.   olgx_set_single_color(),
  586.   olgx_stipple_rect(),
  587.   olgx_scroll_stipple_rects(),
  588.   olgx_draw_accel_button(),
  589.   olgx_draw_accel_choice_item(),
  590.   olgx_draw_accel_label(),
  591.   olgx_draw_elevator(),
  592.   olgx_draw_button(),
  593.   olgx_draw_choice_item(),
  594.   olgx_draw_scrollbar(),
  595.   olgx_draw_menu_mark(),
  596.   olgx_draw_abbrev_button(),
  597.   olgx_draw_slider(),
  598.   olgx_draw_horizontal_slider(),
  599.   olgx_draw_vertical_slider(),
  600.   olgx_draw_resize_corner(),
  601.   olgx_draw_textscroll_button(),
  602.   olgx_draw_numscroll_button(),
  603.   olgx_draw_gauge(),
  604.   olgx_draw_horiz_gauge(),
  605.   olgx_draw_vertical_gauge(),
  606.   olgx_draw_pushpin(),
  607.   olgx_draw_box(),
  608.   olgx_draw_text(),
  609.   olgx_draw_text_ledge(),
  610.   olgx_draw_check_box();
  611.  
  612.  
  613. #endif    /* !OL_PUBLIC_DEFINED */
  614.